Skip to content

fix(cli): detect stale local postgres before declarative sync#5646

Open
pjpjq wants to merge 1 commit into
supabase:developfrom
pjpjq:codex/check-stale-local-postgres
Open

fix(cli): detect stale local postgres before declarative sync#5646
pjpjq wants to merge 1 commit into
supabase:developfrom
pjpjq:codex/check-stale-local-postgres

Conversation

@pjpjq

@pjpjq pjpjq commented Jun 22, 2026

Copy link
Copy Markdown

What

  • Add a declarative schema sync guard that inspects the local Postgres container image tag before generating a migration.
  • Fail with an actionable stop/start suggestion when the running local Postgres container tag is stale.
  • Cover missing, matching, registry-different, and stale local container cases with regression tests.

Why

A stale local Postgres container after a CLI upgrade can produce declarative sync output against an inconsistent local stack, such as incorrect extension drops.

Validation

  • cd apps/cli-go && go test ./cmd ./internal/db/declarative
  • cd apps/cli-go && GOMAXPROCS=4 go test ./...
  • git diff --check

Fixes #5555

@pjpjq pjpjq requested a review from a team as a code owner June 22, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI does not detect stale local Postgres container version before declarative schema sync

1 participant